package cn.jinhaze.controller.user;

import cn.jinhaze.common.pojo.dto.OrderDTO;
import cn.jinhaze.common.pojo.vo.OrderVO;
import cn.jinhaze.common.result.Result;
import cn.jinhaze.service.OrderService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.ibatis.jdbc.Null;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: L29
 * @create: 2024-12-25 12:05
 * @Version 1.0
 */
@RestController
@RequestMapping("/user/order")
@Tag(name = "用户订单业务", description = "用户订单相关接口")
public class UserOrderController {

	@Autowired
	private OrderService orderService;

	@PostMapping("/createOrder")
	@Operation(summary = "下单")
	public Result<OrderVO> createOrder(@RequestBody OrderDTO orderDTO) {
		OrderVO order = orderService.createOrder(orderDTO);
		return Result.success(order);
	}
}